<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fn(a){
           
            var b= a.join(',');//toString() //...arr   es6
            return b;
        }
//         将数组转换成字符串
// “red”,”green”,”blue”,”pink”

console.log(fn(['red','green','blue','pink']))
    </script>
</body>
</html>